#ifndef COLLISIONCHECKER_H
#define COLLISIONCHECKER_H

#include <list>
#include "Sprite.h"

#define RIGHT_BORDER 512
#define LEFT_BORDER 0

class CollisionChecker {
    typedef std::pair<Sprite*, Sprite*> Pair;
    std::list<Pair> pairs;
	static CollisionChecker *collisionChecker;
    struct CheckFunctor : public std::unary_function<Pair, void> {
       void operator()(const Pair& p) const { p.first->CollisionCheck(p.second); }
    };
protected:
	CollisionChecker(void);
public:
	static void Initialize(void);
	static CollisionChecker *GetSingleton(void);
	static bool collidesWithBoarders(Sprite *s);
    void RegisterHearts(Sprite* s1);
	void Register(Sprite* s1, Sprite* s2);
	void Cancel(Sprite* s1, Sprite* s2);
	void Check (void) const;
};

#endif